<!--<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<c:set var="path" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>首营企业管理</title>

<link rel="stylesheet" type="text/css"
	href="/Medical_Instrument/statics/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" href="/Medical_Instrument/statics/css/settingCategory.css" />
<link rel="stylesheet" href="/Medical_Instrument/statics/css/toSupplier.css" />
<style type="text/css">
.loadingModal {
	margin: 220px auto;
}

* {
	margin: 0;
	padding: 0;
}

.div-nav h2 {
	font-weight: 500;
	text-align: center;
	padding: 30px 0 40px;
	border-bottom: 1px solid #92A5C7;
	background: linear-gradient(#F3F8FF, #E2EEFF, #BCD9FF);
}

.buttons {
	display: inline-block;
	font-size: 14px;
	border-radius: 10px 10px 0 0;
	border: 1px solid #9DA0A4;
	padding: 4px;
	text-align: center;
	background: linear-gradient(#DEECFF, #CAE1FF, #B6D6FF);
	color: #1E90FF;
	padding: 0 5px;
	height: 25px;
	line-height: 25px;
}

.but-width {
	width: 100px;
}

.div-width {
	width: 120px;
}

.buttons:hover {
	cursor: pointer;
	background: linear-gradient(#B6D6FF, #CAE1FF, #DEECFF);
}

.nav_span {
	margin-top: -27px;
}

.div_button {
	width: 120px;
	float: right;
	margin: 50px 40px 0 0;
}

.div_button li {
	margin-bottom: 10px;
	height: 27px;
}

.div_table {
	width: 1450px;
	display: inline-block;
	overflow: auto;
	margin: 30px 0 30px 30px;
	border: 5px solid #1E90FF;
	padding: 20px;
	height: 600px;
}

.required_field {
	color: red;
}

.modal-body table tr td div {
	display: inline;
}
</style>
<script type="text/javascript"
	src="/Medical_Instrument/statics/lib/jquery/1.9.1/jquery.min.js"></script>
</head>

<body>
	<div style="width: 1723px">
		<div class="div-nav">
			<h2>首营企业</h2>
			<nav class="nav_span ">

				<span class="buttons but-width" data-toggle="modal"
					data-target="#modals" onclick="show_table($(this),1)"
					style="margin-left: 10px; border-bottom: 1px solid white; background: white;">基本资料</span>

				<span class="buttons but-width" data-toggle="modal"
					data-target="#modals" onclick="show_table($(this),2)">业务部签字</span>

				<span class="buttons but-width" data-toggle="modal"
					data-target="#modals" onclick="show_table($(this),3)">质量管理员签字</span>

				<span class="buttons but-width" data-toggle="modal"
					data-target="#modals" onclick="show_table($(this),4)">质量管理部签字</span>

				<span class="buttons but-width" data-toggle="modal"
					data-target="#modals" onclick="show_table($(this),5)">质量负责人签字</span>

				<span class="buttons but-width" data-toggle="modal"
					data-target="#modals" onclick="show_table($(this),6)">待转为供货方</span>

				<span class="buttons but-width" data-toggle="modal"
					data-target="#modals" onclick="show_table($(this),7)">已转为供货方</span>

			</nav>
		</div>
		<div style="width: 100%;">
			<div class="div_table cont_right">
				<table id="firstEnterpriseInfo" width="2800"
					class="table table-border table-bordered table-hover table-bg">
					<thead>
						<tr class="text-c">
							<th>供方编号</th>
							<th>企业名称</th>
							<th>拼音码</th>
							<th>联系人</th>
							<th>联系电话</th>
							<th>公司电话</th>
							<th>详细地址</th>
							<th>品种控制</th>
							<th>税号</th>
							<th>委托书有效期</th>
							<th>许可证号</th>
							<th>统一社会信用代码</th>
							<th>营业执照有效期</th>
							<th>营业执照经营方式</th>
							<th>器械许可证</th>
							<th>质保协议有效期</th>
							<th>质量认证情况</th>
							<th>质量机构负责人</th>
							<th>质量机构人数</th>
							<th>质量机构联系方式</th>
							<th>备案凭证编号</th>
							<th>回撤原因</th>
							<th>备注</th>
						</tr>
					</thead>
					<tbody>
					</tbody>
				</table>


			</div>
			<div class="div_button">
				<ul>
					<li class="div-width"><span class="btn btn-primary"
						style="border-radius: 10px; " data-toggle="modal"
						data-target="#addbusiness" onclick="buttonStatus('新增')">新增</span>
					</li>
					<li class="div-width"><span class="btn btn-primary"
						style="border-radius: 10px; " data-toggle="modal"
						data-target="#addbusiness" id="updateEnterprise"
						onclick="updateEnterprise()">修改</span></li>
					<li class="div-width"><span class="btn btn-primary"
						style="border-radius: 10px;" onclick="deleteEnterprise()">删除</span>
					</li>

					<li class="div-width"><span class="btn btn-primary"
						style="border-radius: 10px; " data-toggle="modal"
						data-target="#addbusiness" id="lookEnterprise"
						onclick="lookEnterprise()">查看</span></li>

					<li class="div-width"><span class="btn btn-primary"
						style="border-radius: 10px; display: none;" data-toggle="modal"
						data-target="#addbusiness" id="businessSign"
						onclick="buttonStatus('业务部')">业务部签字</span></li>

					<li class="div-width"><span class="btn btn-primary"
						style="border-radius: 10px; display: none;" data-toggle="modal"
						data-target="#addbusiness" id="qualityAdminSign"
						onclick="buttonStatus('质量管理员')">质量管理员签字</span></li>

					<li class="div-width"><span class="btn btn-primary"
						style="border-radius: 10px; display: none;" data-toggle="modal"
						data-target="#addbusiness" id="qualityDeptSign"
						onclick="buttonStatus('质量管理部')">质量管理部签字</span>
					</li>

					<li class="div-width"><span class="btn btn-primary"
						style="border-radius: 10px; display: none;" data-toggle="modal"
						data-target="#addbusiness" id="qualityPeopleSign"
						onclick="buttonStatus('质量负责人')">质量负责人签字</span>
					</li>

					<li class="div-width"><span class="btn btn-primary"
						style="border-radius: 10px; display: none;" data-toggle="modal"
						data-target="#withdrawModal" onclick="revocation()"
						id="revocation">撤销</span>
					</li>

					<li class="div-width"><span class="btn btn-primary"
						style="border-radius: 10px; display: none;" data-toggle="modal"
						data-target="#waitForProviderModal" id="waitForProvider"
						onclick="buttonStatus('转为供货方')">转为供货方</span></li>
				</ul>
			</div>
		</div>
	</div>

	<!--
	            新增首营企业
        -->
	<div class="modal inmodal fade" id="addbusiness" tabindex="-1"
		role="dialog" aria-hidden="true" style="z-index: 50;overflow-y:auto;">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
					<h4 class="modal-title" style="text-align: center;">首营企业</h4>
					<!--<small class="font-bold">这里可以显示副标题。</small>-->
				</div>
				<div class="modal-body">
					<form style="font-size: 16px;" id="firstEnterpriseForm">
						<table class="businesstable"
							style="border-collapse: separate; border-spacing:20px 10px;">
							<tr>
								<td style="float: left;">
									<div>
										&nbsp;&nbsp;<span>首营编号</span> <input type="text"
											name="firstNo" id="firstNo" onblur="JudgefirstNo()" placeholder="(格式，例：1000)"/>
									</div>
								</td>
								<td style="float: left;margin-left: 26px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span>供方编号</span> <input type="text"
											name="supplierEnterpriseNo" id="supplierEnterpriseNo"
											readonly="readonly" />
									</div>
								</td>
								<td style="float: left;">
									<div>
										&nbsp;&nbsp;&nbsp; <input type="checkbox"
											name="isVarietyControl" id="isVarietyControl" /><span>品种控制</span>
										<input type="hidden" id="varietyControl" name="varietyControl"
											value="" />
									</div>
								</td>
								<td style="float: left;">
									<div>
										&nbsp;&nbsp;&nbsp; <input type="checkbox"
											name="isSellColdItem" id="isSellColdItem" /><span>允许经营冷藏品</span>
										<input type="hidden" id="sellColdItem" name="sellColdItem"
											value="" />
									</div>
								</td>
								<td style="position: absolute;right: 50px;top: 17px;">
									<div>
										&nbsp;&nbsp;<span class="required_field">填表日期</span> <input
											class="input-text Wdate" type="text" id="inputDate"
											name="inputDate" readonly="readonly"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" />
									</div>
								</td>
							</tr>
							<tr>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span class="required_field">生产经营类别</span> <select
											style="width: 110px;" name="manageType" id="manageType">
											<option value="1">经营企业</option>
											<option value="2">生产企业</option>
										</select>
									</div>
								</td>
								<td style="float: left;margin-left: 37px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span>输入码</span> <input type="text"
											name="inputCode" id="inputCode" />
									</div>
								</td>
								<td style="float: left;margin-left: 12px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span class="required_field">联系人</span> <input
											type="text" name="linkman" id="linkman" />
									</div>
								</td>
								<td style="position: absolute;right: 50px;top: 57px;">
									<div>
										&nbsp;&nbsp;&nbsp; <span class="required_field">联系电话</span> <input
											type="text" name="linkphone" id="linkphone" />
									</div>
								</td>
							</tr>

							<tr>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span class="required_field">企业名称</span> <input
											type="text" name="enterpriseName" id="enterpriseName" />
									</div>
								</td>
								<td style="float: left;margin-left: 13px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span class="required_field">法定代表人</span> <input
											name="legalPerson" id="legalPerson" type="text" />
									</div>
								</td>
								<td style="float: left;">
									<div>
										&nbsp;&nbsp;&nbsp;<span class="required_field">质量认证情况</span> <select
											name="qualitySituation" id="qualitySituation"
											style="width: 110px;">
											<option value="0">不合格</option>
											<option value="1">合格</option>
										</select>
									</div>
								</td>
							</tr>
							<tr>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span class="required_field">注册地址</span> <input
											type="text" name="registerAddress" id="registerAddress" />
									</div>
								</td>
								<td style="float: left;margin-left: 13px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span class="required_field">企业负责人</span> <input
											type="text" name="enterprisePerson" id="enterprisePerson" />
									</div>
								</td>
								<td style="position: absolute;right: 50px;top: 117px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span>质量机构人数</span> <input type="text"
											name="ahrqPeopleCount" id="ahrqPeopleCount" />
									</div>
								</td>
							</tr>
							<tr>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span class="required_field">仓库地址</span> <input
											type="text" name="warehouseAddress" id="warehouseAddress" />
									</div>
								</td>
								<td style="float: left;margin-left: 13px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span class="required_field">质量负责人</span> <input
											type="text" name="qualityDirecter" id="qualityDirecter" />
									</div>
								</td>
								<td style="position: absolute;right: 50px;top: 147px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span>质量机构联系方式</span> <input type="text"
											name="nhrqContactWay" id="nhrqContactWay" />
									</div>
								</td>
							</tr>

							<tr>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span class="required_field">开户银行</span> <input
											type="text" name="bank" id="bank" />
									</div>
								</td>
								<td style="position: absolute;right: 50px;top: 177px;">
									<div>
										&nbsp;&nbsp;<span class="required_field">委托书有效期</span> <input
											class="input-text Wdate" type="text"
											name="entrustLimitedDate" id="entrustLimitedDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" />
									</div>
								</td>
							</tr>

							<tr>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span class="required_field">银行账号</span> <input
											type="text" name="bankAccount" id="bankAccount"
											onkeyup="formatBankNo(this)" onkeydown="formatBankNo(this)" />
									</div>
								</td>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span class="required_field">组织机构代码证</span> <input
											type="text" name="organizationNo" id="organizationNo" />
									</div>
								</td>

								<td style="position: absolute;right: 50px;top: 215px;">
									<div>
										&nbsp;&nbsp;<span class="required_field">机构代码证有效期</span> <input
											class="input-text Wdate" type="text"
											name="organizationLimitedDate" id="organizationLimitedDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" />
									</div>
								</td>
							</tr>

							<tr>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>税号</span>
										<input type="text" name="dutyNo" id="dutyNo" />
									</div>
								</td>
								<td style="float: left;">
									<div>
										&nbsp;&nbsp;<span class="required_field">质保协议起始期</span> <input
											class="input-text Wdate" type="text" name="qualityStartDate"
											id="qualityStartDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" />
									</div>
								</td>

								<td style="position: absolute;right: 50px;top: 250px;">
									<div>
										&nbsp;&nbsp;<span class="required_field">质保协议有效期</span> <input
											class="input-text Wdate" type="text" name="qualityEndDate"
											id="qualityEndDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" />
									</div>
								</td>
							</tr>

							<tr>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span>公司电话</span> <input type="text"
											name="enterprisePhone" id="enterprisePhone" />
									</div>
								</td>
								<td style="float: left;margin-left: 35px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span>邮政编码</span> <input type="text"
											name="postcode" id="postcode" />
									</div>
								</td>
							</tr>
							<tr>
								<td>
									<div>
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>备注</span>
										<input type="text" style="width: 700px;" name="remark"
											id="remark" />
									</div>
								</td>
							</tr>

							<tr style="border-bottom: 3px solid;border-top: 3px solid;">
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span class="required_field">许可证号</span> <input
											type="text" style="width: 250px;" name="licenseNo"
											id="licenseNo" />
									</div>
								</td>
								<td style="float: left;margin-left: 13px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span class="required_field">备案凭证编号</span> <input
											type="text" name="recordsNo" id="recordsNo" />
									</div>
								</td>
								<td style="position: absolute;right: 50px;top: 340px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span class="required_field">发证日期</span> <input
											class="input-text Wdate" type="text"
											name="certificateStartDate" id="certificateStartDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" />
									</div>
								</td>
							</tr>

							<tr>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span class="required_field">发证机关</span> <input
											type="text" style="width: 250px;" name="certificateAuthority"
											id="certificateAuthority" />
									</div>
								</td>

								<td style="position: absolute;right: 50px;top: 370px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span class="required_field">有效期至</span> <input
											class="input-text Wdate" type="text"
											name="certificateEndDate" id="certificateEndDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" />
									</div>
								</td>
							</tr>

							<tr>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span class="required_field">统一社会信用代码</span> <input
											type="text" style="width: 200px;" name="socialCreditCode"
											id="socialCreditCode" />
									</div>
								</td>
								<td style="float: left;margin-left: 39px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span class="required_field">经济性质</span> <input
											type="text" name="economicNature" id="economicNature" />
									</div>
								</td>
								<td style="position: absolute;right: 50px;top: 410px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span class="required_field">发照日期</span> <input
											class="input-text Wdate" type="text" name="businessStartDate"
											id="businessStartDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" />
									</div>
								</td>
							</tr>

							<tr>
								<td style="float: left;" colspan="2">
									<div>
										&nbsp;&nbsp;<span class="required_field">发照机关</span> <input
											type="text" style="width: 250px;"
											name="certificateAuthorityOffice"
											id="certificateAuthorityOffice" />
									</div>
								</td>
								<td style="float: left;margin-left: 39px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span>注册资金(元)</span> <input type="text"
											name="registeredFund" id="registeredFund" />
									</div>
								</td>
								<td style="position: absolute;right: 50px;top: 440px;">
									<div>
										&nbsp;&nbsp;&nbsp;<span class="required_field">执照有效期</span> <input
											class="input-text Wdate" type="text" name="businessEndDate"
											id="businessEndDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" />
									</div>
								</td>
							</tr>

							<tr>
								<td>
									<div id="businessScope">
										<span class="required_field">商品经营范围控制</span> <a
											class="btn btn-info"
											style="position: absolute;right: 60px;top: 490px;"
											data-toggle="modal" data-target="#setting"
											onclick="settings()" id="set">设置</a>
										<textarea cols="120" rows="4" id="business_scope"></textarea>
									</div>
								</td>
							</tr>

							<tr>
								<td style="float: left;">
									<div>
										&nbsp;&nbsp;<span>网上查询</span> <input type="text"
											style="width: 250px;" name="onlineEnquiry" id="onlineEnquiry"
											readonly="readonly" />
									</div>
								</td>
							</tr>

							<tr>
								<td style="float: left;">
									<div>
										&nbsp;&nbsp;<span>质量审批人结论</span> <select disabled="disabled"
											name="qualityPeopleConclusion" id="qualityPeopleConclusion">
											<option value="0"></option>
											<option value="1">合格</option>
											<option value="2">不合格</option>
										</select>
									</div>
								</td>
							</tr>

							<tr>
								<td style="float: left;">
									<div>
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>业务部意见</span>
										<select style="width: 200px;" disabled="disabled"
											name="businessDepOpinion" id="businessDepOpinion">
											<option value="0"></option>
											<option value="1">合格</option>
											<option value="2">不合格</option>
										</select>
									</div>
								</td>
								<td style="float: left;margin-left: 150px;">
									<div>
										<input type="text" name="businessDepName" id="businessDepName"
											readonly="readonly" />
									</div>
								</td>
								<td id="date01"
									style="position: absolute;right: 50px;top: 625px;">
									<div>
										&nbsp;&nbsp;<span>签字日期</span> <input class="input-text Wdate"
											type="text" name="businessAuditDate" id="businessAuditDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" readonly="readonly" />
									</div>
								</td>
							</tr>
							<tr>
								<td style="float: left;">
									<div>
										&nbsp;&nbsp;<span>质量管理员结论</span> <select style="width: 200px;"
											disabled="disabled" name="qualityAdminConclusion"
											id="qualityAdminConclusion">
											<option value="0"></option>
											<option value="1">合格</option>
											<option value="2">不合格</option>
										</select>
									</div>
								</td>
								<td style="float: left;margin-left: 150px;">
									<div>
										<input type="text" name="qualityAdminName"
											id="qualityAdminName" readonly="readonly" />
									</div>
								</td>
								<td id="date02"
									style="position: absolute;right: 50px;top: 655px;">
									<div>
										&nbsp;&nbsp;<span>签字日期</span> <input class="input-text Wdate"
											type="text" name="qualityAdminDate" id="qualityAdminDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" readonly="readonly" />
									</div>
								</td>
							</tr>
							<tr>
								<td style="float: left;">
									<div>
										&nbsp;&nbsp;<span>质量管理部意见</span> <select style="width: 200px;"
											disabled="disabled" name="qualityDeptOpinion"
											id="qualityDeptOpinion">
											<option value="0"></option>
											<option value="1">合格</option>
											<option value="2">不合格</option>
										</select>
									</div>
								</td>
								<td style="float: left;margin-left: 150px;">
									<div>
										<input type="text" name="qualityDeptName" id="qualityDeptName"
											readonly="readonly" />
									</div>
								</td>
								<td id="date03"
									style="position: absolute;right: 50px;top: 685px;">
									<div>
										&nbsp;&nbsp;<span>签字日期</span> <input class="input-text Wdate"
											type="text" name="qualityDeptDate" id="qualityDeptDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" readonly="readonly" />
									</div>
								</td>
							</tr>
							<tr>
								<td style="float: left;">
									<div>
										&nbsp;&nbsp;<span>质量负责人意见</span> <select style="width: 200px;"
											disabled="disabled" name="qualityPeopleOpinion"
											id="qualityPeopleOpinion">
											<option value="0"></option>
											<option value="1">合格</option>
											<option value="2">不合格</option>
										</select>
									</div>
								</td>
								<td style="float: left;margin-left: 150px;">
									<div>
										<input type="text" name="qualityPeopleName"
											id="qualityPeopleName" readonly="readonly" />
									</div>
								</td>
								<td id="date04"
									style="position: absolute;right: 50px;top: 715px;">
									<div>
										&nbsp;&nbsp;<span>签字日期</span> <input class="input-text Wdate"
											type="text" name="qualityPeopleOpinionDate"
											id="qualityPeopleOpinionDate"
											onfocus="WdatePicker({dateFmt:'yyyy-MM-dd', defaultDate:'#now'})"
											style="width: 140px;" readonly="readonly" />
									</div>
								</td>
							</tr>
						</table>

					</form>
				</div>

				<div class="modal-footer">

					<!-- 质量管理员拥有回撤权限 -->
					<button type="button" class="btn btn-primary" id="withdraw"
						style="position: absolute;left: 20px;display: none;"
						data-toggle="modal" data-target="#withdrawModal"
						onclick="sign('#operatorName_wd')">回撤</button>

					<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary" id="save"
						data-dismiss="modal" style="display: inline-block;">保存</button>
					<input type="hidden" value="add" id="isAddOrUpdate" />
					<button type="button" class="btn btn-primary" data-toggle="modal"
						id="businessDept" data-target="#business" style="display: none;"
						onclick="sign('#operatorName')">业务部签字</button>
					<button type="button" class="btn btn-primary" id="qualityAdmin"
						data-toggle="modal" data-target="#qcsign" style="display: none;"
						onclick="sign('#operatorName_QA')">质量管理员签字</button>
					<button type="button" class="btn btn-primary"
						style="display: none;" id="qualityDept" data-toggle="modal"
						data-target="#qcdepsign" onclick="sign('#operatorName_QD')">质量理部签字</button>
					<button type="button" class="btn btn-primary"
						style="display: none;" id="qualityPeople" data-toggle="modal"
						data-target="#qcpeosign" onclick="sign('#operatorName_QP')">质量负责人签字</button>

				</div>
			</div>
		</div>
	</div>

	<!--
        	作者：offline
        	时间：2018-09-05
        	描述： 设置器械分类
        -->
	<div class="modal inmodal fade" id="setting" tabindex="-1"
		role="dialog" aria-hidden="true" style="z-index: 55;">
		<div class="modal-dialog modal-lg"
			style="width: 1420px;height: 1200px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
					<h4 class="modal-title">选择器械分类</h4>
					<!--<small class="font-bold">这里可以显示副标题。</small>-->
				</div>
				<div class="modal-body">
					<div class="category_div">
						<div
							style="border: 1px solid black;height: 580px;overflow-y: auto;">
							<h2 style="text-align: center;font-weight: bold;">未选分类</h2>
							<form>
								<ul class="category_ul">
									<li>从当前数据中检索： <input type="text" name="searchContent"
										id="searchContent" style="width: 200px;" /></li>
								</ul>
							</form>
							<table border="1" style="width:600px;font-size: 20px;"
								id="unselectedCategory">

							</table>

						</div>
						<span id="record_count"
							style="position: absolute;bottom: 1px;left: 30px;font-size: 18px;">合计：共365条记录</span>
						<div style="position: absolute;top: 200px;">
							<input type="button"
								style="background-image: url(/Medical_Instrument/statics/image/right.jpg); width: 110px; height: 80px;margin-bottom: 50px;border: 0;"
								onclick="selected()"></input> <br /> <input type="button"
								style="background-image: url(/Medical_Instrument/statics/image/left.jpg); width: 110px; height: 80px; border: 0;"
								onclick="unselected()"></input>
						</div>

						<div
							style="border: 1px solid black;float: right;height: 580px;overflow-y: auto;">
							<h2 style="text-align: center;font-weight: bold;">已选分类</h2>
							<form action="">
								<ul class="category_ul">
									<li>从当前数据中检索： <input type="text" name="searchContent_"
										id="searchContent_" style="width: 200px;" /></li>
								</ul>
							</form>
							<table border="1" style="width:600px;font-size: 20px;"
								id="selectedCategory">
								<tr id="theader_">
									<td><input type='checkbox' /></td>
									<td>分类编号</td>
									<td>代码编号</td>
									<td>分类代码</td>
									<td>管理类别</td>
								</tr>
							</table>
						</div>
					</div>
				</div>
				<span id="record_count_"
					style="position: absolute;bottom: 50px;right: 30px;font-size: 18px;">合计：共0条记录</span>
				<div class="modal-footer">
					<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary"
						onclick="saveBusinessScope()">保存</button>
				</div>
			</div>
		</div>
	</div>

	<!-- 业务部签字弹出框 -->
	<div id="business" class="modal fade bs-example-modal-lg">
		<div class="modal-dialog " class="loadingModal">
			<div class="modal-content">
				<div class="modal-header">
					<h4 class="modal-title" style="text-align: center;">业务部签字</h4>
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
				</div>
				<div class="modal-body">
					<div class="mt-20">
						<form style="font-size: 18px;">
							<div style="margin-top: 30px;margin-bottom: 80px;">
								业务部意见 <select style="width: 412px;font-size: 18px;"
									name="businessDepOpinionSign" id="businessDepOpinionSign">
									<option value="0"></option>
									<option value="1">同意</option>
								</select>
							</div>

							<div style="margin-bottom: 30px;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>操作员</span> <input
									type="text" style="width: 412px;font-size: 18px;"
									name="operatorName" id="operatorName" readonly="readonly" />
							</div>

							<div>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>密码</span>
								<input type="password" style="width: 412px;font-size: 18px;"
									name="operatorPassword" id="operatorPassword" />
							</div>

						</form>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary"
						onclick="businessSignSave()">保存</button>
				</div>
			</div>

		</div>

	</div>

	<!-- 回撤原因弹出框 -->
	<div id="withdrawModal" class="modal fade bs-example-modal-lg">
		<div class="modal-dialog " class="loadingModal">
			<div class="modal-content">
				<div class="modal-header">
					<h4 class="modal-title" style="text-align: center;">首营企业</h4>
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
				</div>
				<div class="modal-body">
					<div class="mt-20">
						<form style="font-size: 18px;">
							<div style="margin-top: 30px;margin-bottom: 80px;">

								&nbsp;&nbsp; <span>回撤原因</span> <input type="text"
									style="width: 412px;font-size: 18px;" id="retracementReason" />
							</div>

							<div>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>操作员</span> <input
									type="text" style="width: 412px;font-size: 18px;"
									name="operatorName_wd" id="operatorName_wd" />
							</div>

							<div style="margin-top: 20px;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>密码</span>
								<input type="password" style="width: 412px;font-size: 18px;"
									name="password_wd" id="password_wd" />
							</div>

						</form>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary"
						onclick="withdrawSign()">保存</button>
				</div>
			</div>
		</div>
	</div>


	<!-- 质量管理员签字弹出框 -->
	<div id="qcsign" class="modal fade bs-example-modal-lg">
		<div class="modal-dialog " style="margin: 180px auto;width: 40%;">
			<div class="modal-content">
				<div class="modal-header">
					<h4 class="modal-title" style="text-align: center;">首营企业</h4>
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
				</div>
				<div class="modal-body">
					<div class="mt-20">
						<form style="font-size: 18px;">
							<div
								style="margin-top: 30px;margin-bottom: 50px;margin-left:75px;">
								网上查询 <select style="width: 420px;font-size: 18px;"
									name="onlineEnquiry_QA" id="onlineEnquiry_QA">
									<option value="0"></option>
									<option value="1">与网上查询一致</option>
								</select>
							</div>

							<div
								style="margin-top: 30px;margin-bottom: 120px;margin-left: 25px;">
								质量管理员结论 <select style="width: 418px;font-size: 18px;"
									name="qualityAdminConclusion_QA" id="qualityAdminConclusion_QA">
									<option value="0"></option>
									<option value="1">同意</option>
								</select>
							</div>

							<div style="margin-bottom: 30px;text-align: center;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>操作员</span> <input
									type="text" style="width: 412px;font-size: 18px;"
									name="operatorName_QA" id="operatorName_QA" readonly="readonly" />
							</div>

							<div style="text-align: center;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>密码</span>
								<input type="password" name="password_QA" id="password_QA"
									style="width: 412px;font-size: 18px;" />
							</div>
						</form>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary"
						onclick="qualityAdminSignSave()">保存</button>
				</div>
			</div>

		</div>

	</div>

	<!-- 质量管理部签字弹出框 -->
	<div id="qcdepsign" class="modal fade bs-example-modal-lg">
		<div class="modal-dialog " style="margin: 180px auto;width: 40%;">
			<div class="modal-content">
				<div class="modal-header">
					<h4 class="modal-title" style="text-align: center;">首营企业</h4>
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
				</div>
				<div class="modal-body">
					<div class="mt-20">
						<form style="font-size: 18px;">
							<div
								style="margin-top: 30px;margin-bottom: 120px;margin-left: 30px;">
								质量管理部意见 <select style="width: 418px;font-size: 18px;"
									name="qualityDeptOpinion_QD" id="qualityDeptOpinion_QD">
									<option value="0"></option>
									<option value="1">同意</option>
								</select>
							</div>

							<div style="margin-bottom: 30px;text-align: center;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>操作员</span> <input
									type="text" style="width: 412px;font-size: 18px;"
									name="operatorName_QD" id="operatorName_QD" />
							</div>

							<div style="text-align: center;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>密码</span>
								<input type="password" style="width: 412px;font-size: 18px;"
									name="password_QD" id="password_QD" />
							</div>

						</form>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary"
						onclick="qualityDeptSignSave()">保存</button>
				</div>
			</div>

		</div>

	</div>

	<!-- 质量负责人签字弹出框 -->
	<div id="qcpeosign" class="modal fade bs-example-modal-lg">
		<div class="modal-dialog " style="margin: 180px auto;width: 40%;">
			<div class="modal-content">
				<div class="modal-header">
					<h4 class="modal-title" style="text-align: center;">首营企业</h4>
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
				</div>
				<div class="modal-body">
					<div class="mt-20">
						<form style="font-size: 18px;">
							<div
								style="margin-top: 30px;margin-bottom: 30px;margin-left: 20px;">
								质量负责人审批结论 <select style="width: 418px;font-size: 18px;"
									name="qualityPeopleConclusion_QP"
									id="qualityPeopleConclusion_QP">
									<option value="0"></option>
									<option value="1">同意作为合格供货方</option>
								</select>
							</div>

							<div
								style="margin-top: 30px;margin-bottom: 120px;margin-left: 20px;">
								质量负责人审批意见 <select style="width: 418px;font-size: 18px;"
									name="qualityPeopleOpinion_QP" id="qualityPeopleOpinion_QP">
									<option value="0"></option>
									<option value="1">同意</option>
								</select>
							</div>


							<div style="margin-bottom: 30px;text-align: center;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>操作员</span> <input
									type="text" style="width: 412px;font-size: 18px;"
									name="operatorName_QP" id="operatorName_QP" />
							</div>

							<div style="text-align: center;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>密码</span>
								<input type="password" style="width: 412px;font-size: 18px;"
									name="password_QP" id="password_QP" />
							</div>

						</form>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary"
						onclick="qualityPeopleSignSave()">保存</button>
				</div>
			</div>

		</div>
	</div>


	<!-- 转为供货方弹出框 -->
	<div class="modal inmodal fade" id="waitForProviderModal" tabindex="-1"
		role="dialog" aria-hidden="true" style="z-index: 50;">
		<div class="modal-dialog modal-lg"
			style="width:960px; height:700px;margin:20px auto;">
			<div class="modal-content" style="width:960px;">
				<div class="modal-header"
					style="background: linear-gradient(#FFFFFF,#E8F2FF,#BDD9FF);">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
					<h4 class="modal-title"
						style="font-size: 26px; font-weight: 600; text-align: center; ">供应商资料</h4>
				</div>
				<div class="modal-body"
					style="background: linear-gradient(#EDF2FA,#BFD3EC,#A2BFE5);">
					<ul>
						<li style="width: 80px;" onclick="change_back($(this),1)">基本信息</li>
						<li style="width: 0px"></li>
						<li style="width: 120px; background: lightsteelblue;"
							onclick="change_back($(this),2)">供货方人员信息</li>
					</ul>
					<div class="modal-body-content">
						<div class="upper">
							<form action="" id="providerInfoForm">
								<div class="Essential-infor">
									<div style="margin: 0 0 5px 654px;">
										备案凭证编号 <input type="text" disabled="disabled"
											class="people-three input-back" name="recordsNo" />
									</div>
									<ol style="width: 415px; display: inline-block;">
										<li><span class="red">经营类别</span> <select
											name="manageType" style="width: 190px; height: 23px;"
											disabled="disabled">
												<option value="1">生产企业</option>
												<option value="2">经营企业</option>
										</select> &nbsp;<span>供方编号</span> <input type="text"
											name="supplierEnterpriseNo"
											style="width: 94px; height: 23px;" readonly='readonly' /></li>
										<li><span class="red">企业名称</span> <input type="text"
											name="enterpriseName" style="width: 188px; height: 23px;"
											readonly='readonly' /> &nbsp; <span>输入码</span> <input
											name="inputCode" type="text"
											style="width: 94px; height: 23px;" readonly='readonly' /></li>
										<li><span class="red">注册地址</span> <input type="text"
											name="registerAddress" style="width: 351px; height: 23px;"
											readonly='readonly' />
										</li>
										<li><span class="red">仓库地址</span> <input type="text"
											name="warehouseAddress" style="width: 351px; height: 23px;"
											readonly='readonly' />
										</li>
										<li><span class="red">开户银行</span> <input type="text"
											name="bank" style="width: 351px; height: 23px;"
											readonly='readonly' />
										</li>
										<li><span class="red">银行账户</span> <input type="text"
											name="bankAccount" style="width: 351px; height: 23px;"
											readonly='readonly' />
										</li>
										<li><span><span style="opacity: 0;">税号</span>税号</span> <input
											name="dutyNo" type="text" style="width: 351px; height: 23px;"
											readonly='readonly' />
										</li>
										<li><span>公司电话</span> <input type="text"
											name="enterprisePhone" style="width: 208px; height: 23px;"
											readonly='readonly' /> <span>邮政编码</span> <input type="text"
											style="width: 76px; height: 23px;" name="postcode"
											readonly='readonly' />
										</li>
										<li><span>应收额</span> <input type="text"
											style="width: 76px; height: 23px;" readonly='readonly' />&nbsp;&nbsp;<span>应付额</span>
											<input type="text" style="width: 76px; height: 23px;"
											readonly='readonly' /> &nbsp;&nbsp; <span>预付款</span> <input
											type="text" style="width: 77px; height: 23px;"
											readonly='readonly' /></li>
									</ol>

									<ol class="people">
										<li><input type="checkbox" name="varietyControl" />品种控制
											<input type="checkbox" name="sellColdItem" />允许经营冷藏品</li>
										<li><span class="red">联系人</span> <input type="text"
											class="people-two" readonly='readonly' name="linkman" />
										</li>
										<li><span class="red">法定代表人</span> <input type="text"
											class="people-two" readonly='readonly' name="legalPerson" />
										</li>
										<li><span class="red">企业负责人</span> <input type="text"
											name="enterprisePerson" class="people-two"
											readonly='readonly' />
										</li>
										<li><span class="red">质量负责人</span> <input type="text"
											name="qualityDirecter" class="people-two" readonly='readonly' />
										</li>
										<li><span style="font-size: 12px;">组织机构代码证</span> <input
											name="organizationNo" type="text" class="people-two"
											readonly='readonly' />
										</li>
										<li><span class="red">许可证编号</span> <input type="text"
											name="licenseNo" class="people-two" readonly='readonly' />
										</li>
										<li><span class="red">营业执照编号</span> <input type="text"
											name="organizationNo" class="people-two" readonly='readonly' />
										</li>
									</ol>
									<ol class="people" style="width: 295px; margin-left: -15px;">
										<li><span class="red">建档时间</span> <input type="text"
											name="inputDate" disabled="disabled"
											class="people-three input-back" />
										</li>
										<li><span class="red">联系电话</span> <input type="text"
											name="enterprisePhone" class="people-three"
											readonly='readonly' />
										</li>
										<li><span class="red">质量认证情况</span> <input type="text"
											name="qualitySituation" class="people-three"
											readonly='readonly' />
										</li>
										<li><span>质量机构人数</span> <input type="text"
											name="ahrqPeopleCount" class="people-three"
											readonly='readonly' />
										</li>
										<li><span>质量机构联系方式</span> <input type="text"
											name="nhrqContactWay" class="people-three"
											readonly='readonly' />
										</li>
										<li><span class="red">委托书有效期</span> <input type="text"
											name="entrustLimitedDate" disabled="disabled"
											class="people-three input-back" />
										</li>
										<li><span style="font-size: 12px;">机构代码证有效期</span> <input
											name="organizationLimitedDate" type="text"
											disabled="disabled" class="people-three input-back" />
										</li>
										<li><span class="red">许可证有效期</span> <input type="text"
											name="certificateEndDate" disabled="disabled"
											class="people-three input-back" />
										</li>
										<li><span class="red">执照有效期</span> <input type="text"
											name="businessEndDate" disabled="disabled"
											class="people-three input-back" />
										</li>
										<li><span style="display: inline-block;width: 300px;"><span
												class="red" style="width: 115px;">质保协议起始日期</span> <input
												name="qualityStartDate" type="text" disabled="disabled"
												class="people-three input-back" /> </span> <span class="red">质保协议有效期</span>
											<input type="text" class="people-three input-back"
											name="qualityEndDate" disabled="disabled" />
										</li>
									</ol>
								</div>
								<div style="margin: 5px 0 0 27px;">
									<span>备注</span> <input type="text" name="remark"
										style="width: 554px; height: 23px;" readonly='readonly' />
								</div>
							</form>
						</div>
						<div class="lower">
							<table
								class="table table-border table-bordered table-hover table-bg dataTable no-footer"
								width="2200">
								<thead>
									<tr class="text-c">
										<th>名称</th>
										<th>职务</th>
										<th>身份证号</th>
										<th>资格证号</th>
										<th>药品分类</th>
										<th>授权商品范围</th>
										<th>授权区域</th>
										<th>授权起始日期</th>
										<th>授权结束日期</th>
										<th>备案结束日期</th>
										<th>授权人</th>
										<th>查询审核人</th>
										<th>查询日期</th>
										<th>审核人</th>
										<th>审核日期</th>
										<th>人员备注</th>
										<th>审核备注</th>
										<th>客户类型</th>
										<th>品种控制</th>
									</tr>
								</thead>
								<tbody>
									<tr class="text-c">
										<td>手术刀</td>
										<td>北大青鸟阿博泰克总部</td>
										<td>规格</td>
										<td>ABTK-002356</td>
										<td>个</td>
										<td>10000</td>
										<td>500</td>
										<td>5000000</td>
										<td>600</td>
										<td>BDQN-05621161156</td>
										<td>BDQN-0365161156</td>
										<td>2020-5-16</td>
										<td>北大青鸟阿博泰克总部后花园</td>
										<td>货位</td>
										<td>促销标价</td>
										<td>手术刀</td>
										<td>北大青鸟阿博泰克总部</td>
										<td>规格</td>
										<td>ABTK-002356</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary"
						onclick="toProvider()">确定</button>
					<button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>


	<script type="text/javascript"
		src="/Medical_Instrument/statics/lib/layer/2.4/layer.js"></script>
	<script type="text/javascript"
		src="/Medical_Instrument/statics/h-ui/js/H-ui.min.js"></script>
	<script type="text/javascript"
		src="/Medical_Instrument/statics/h-ui.admin/js/H-ui.admin.js"></script>
	<script type="text/javascript"
		src="/Medical_Instrument/statics/lib/My97DatePicker/4.8/WdatePicker.js"></script>
	<script type="text/javascript"
		src="/Medical_Instrument/statics/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript"
		src="/Medical_Instrument/statics/lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript"
		src="/Medical_Instrument/statics/js/gsp/business_manage/settingCategory.js"></script>
	<script type="text/javascript"
		src="/Medical_Instrument/statics/js/gsp/business_manage/FirstEnterprise.js"></script>
	<script type="text/javascript"
		src="/Medical_Instrument/statics/js/gsp/business_manage/moment.js"></script>
	<script type="text/javascript"
		src="/Medical_Instrument/statics/js/gsp/business_manage/sign.js"></script>
	<script type="text/javascript"
		src="/Medical_Instrument/statics/js/gsp/common/layerColse.js"></script>
	<script type="text/javascript" src="/Medical_Instrument/statics/js/utils/MD5.js"></script>
	<script type="text/javascript">
		//查看
		function lookEnterprise() {
			attrAuditButton();
			var supplier_enterprise_no = getSelectedNo("look");
			if (supplier_enterprise_no == "" || supplier_enterprise_no == null) {
				$("#lookEnterprise").removeAttr("data-target");
				return;
			}
			$("#lookEnterprise").attr("data-target", "#addbusiness");

			$
					.ajax({
						type : "post",
						url : "/Medical_Instrument/firstEnterprise/getFirstEnterpriseByNo",
						data : {
							"supplier_enterprise_no" : supplier_enterprise_no
						},
						dataType : "json",
						success : function(data) {
							if (data.result != "failed") {
								$("#firstEnterpriseForm").populateForm(
										formatDate(data.result));
								$("#business_scope").val(data.instrumentInfo);
							} else {
								layer.msg('请求失败!', {
									icon : 5,
									time : 1000
								});
							}
							;
						},
						error : function(data) {
							layer.msg('请求失败!', {
								icon : 5,
								time : 1000
							});
						}
					});
			attr(true);
		}

		function attrAuditButton() {
			$("#businessDept").css("display", "none");
			$("#qualityAdmin").css("display", "none");
			$("#qualityDept").css("display", "none");
			$("#qualityPeople").css("display", "none");
			$("#save").css("display", "none");
		}

		function attr(obj) {
			$("#firstEnterpriseForm input").attr("readonly", obj);
			$("#firstEnterpriseForm input").attr("disabled", obj);
			$("#firstEnterpriseForm select").attr("disabled", obj);
			$("#firstEnterpriseForm textarea").attr("readonly", obj);
			$("#set").removeAttr("data-target");
			$("#save").attr("disabled", obj);
		}

		//删除
		function deleteEnterprise() {
			var obj = getSelectedNo("delete");
			if (obj == null) {
				return;
			}
			layer
					.confirm(
							'确认要删除吗？',
							function(index) {
								var supplier_enterprise_no = $(obj).children(
										"td").eq(0).text();
								$
										.ajax({
											type : "post",
											url : "${pageContext.request.contextPath}/firstEnterprise/deleteFirstEnterpriseByNo",
											data : {
												"supplier_enterprise_no" : supplier_enterprise_no
											},
											dataType : "json",
											success : function(data) {
												if (data.result == "success") {
													var table = $(
															'#firstEnterpriseInfo')
															.DataTable();
													table.row('.selected')
															.remove().draw(
																	false);
													layer.msg('已删除!', {
														icon : 1,
														time : 5000
													});
												} else {
													layer.msg('请求失败!', {
														icon : 5,
														time : 1000
													});
												}

											},
											error : function(data) {
												layer.msg('请求失败!', {
													icon : 5,
													time : 1000
												});
											}
										});

							});

		}

		//修改
		function updateEnterprise() {
			var supplier_enterprise_no = getSelectedNo("update");
			if (supplier_enterprise_no == "" || supplier_enterprise_no == null) {
				$("#updateEnterprise").removeAttr("data-target");
				return;
			}
			$("#updateEnterprise").attr("data-target", "#addbusiness");
			$("#set").attr("data-target", "#addbusiness");
			$
					.ajax({
						type : "post",
						url : "${pageContext.request.contextPath}/firstEnterprise/getFirstEnterpriseByNo",
						data : {
							"supplier_enterprise_no" : supplier_enterprise_no
						},
						dataType : "json",
						success : function(data) {
							if (data.result != "failed") {
								$("#firstEnterpriseForm").populateForm(
										formatDate(data.result));
								attr(false);
							} else {
								layer.msg('请求失败!', {
									icon : 5,
									time : 1000
								});
							}
							;
						},
						error : function(data) {
							layer.msg('请求失败!', {
								icon : 5,
								time : 1000
							});
						}
					});

			$("#isAddOrUpdate").val("update");
		}

		//判断当前有没选中行
		function getSelectedNo(info) {
			var object = null;
			$("#firstEnterpriseInfo>tbody").find("tr").each(function() {
				if ($(this).hasClass('selected')) {
					if (info != "delete") {
						object = $(this).children("td").eq(0).text();
						if (object == "没有数据")
							object = null;
					} else {
						object = $(this);
					}
				}
			});
			return object;
		}

		//加载企业信息
		getEnterpriseList("${pageContext.request.contextPath}/firstEnterprise/getFirstEnterpriseList");

		//企业名称输入码
		$("#enterpriseName").blur(
				function() {
					$.post("${path}/inputCode/getInputCodeByName", "name="
							+ $("#enterpriseName").val(), callBack);
					function callBack(data) {
						var obj = JSON.parse(data);
						$("#inputCode").val(obj.inputCode);
					}
					;
				});

		function settings() {
			//设置企业经营范围
			$
					.ajax({
						type : "post",
						url : "${pageContext.request.contextPath}/enterprise/getInstrumentList",
						dataType : "json",
						success : function(data) {
							if (data != null) {
								$("#unselectedCategory").html("");
								var content = "<tr id='theader'><td><input type='checkbox' /></td>"
										+ "<td>分类编号</td>"
										+ "<td>代码编号</td>"
										+ "<td>分类代码</td>"
										+ "<td>管理类别</td></tr>";

								for ( var i = 0; i < data.length; i++) {
									content += "<tr><td><input type='checkbox'/></td>"
											+ "<td>"
											+ data[i].classifyNo
											+ "</td>"
											+ "<td>"
											+ data[i].codeNo
											+ "</td>"
											+ "<td>"
											+ data[i].classifyName
											+ "</td>"
											+ "<td>"
											+ data[i].manageType
											+ "</td></tr>";
								}

								$("#unselectedCategory").html(content);
								$("#record_count").html(
										"合计共 " + data.length + " 条记录");
							}
							;
						},
						error : function(data) {
							layer.msg('请求失败!', {
								icon : 5,
								time : 1000
							});
						}
					});

		}

		$(function() {
			$('.cont_right').scroll(
					function() {
						var obj = $(this);
						var value = obj.scrollLeft();

						$('.dataTables_info')
								.css('margin-left', (value + 'px'));
						$('.dataTables_length').css('margin-left',
								(value + 'px'));

						$('#firstEnterpriseInfo_paginate').css('margin-right',
								('-' + value + 'px'));
						$('.dataTables_filter').css('margin-right',
								('-' + value + 'px'));
					});

			$('#firstEnterpriseInfo tbody').on(
					'click',
					'tr',
					function() {
						if ($(this).hasClass('selected')) {
							$(this).removeClass('selected');
						} else {
							$('#firstEnterpriseInfo tr.selected').removeClass(
									'selected');
							$(this).addClass('selected');
						}
					});

		});

		function show_table(obj, num) {
			$("#firstEnterpriseInfo").dataTable().fnDestroy();
			if (obj != null) {
				obj.siblings().css({
					'border-bottom' : '1px solid #9DA0A4',
					'background' : 'linear-gradient(#DEECFF, #CAE1FF, #B6D6FF)'
				});
				obj.css({
					'border-bottom' : '1px solid white',
					'background' : 'white'
				});
			}
			$('.div_button').find('ul li span').css('display', 'none');
			switch (num) {
			case 1:
				foreach_hide(1, 4);
				getEnterpriseList("${pageContext.request.contextPath}/firstEnterprise/getFirstEnterpriseList");
				break;
			case 2:
				foreach_hide(4, 5);
				getEnterpriseList("${pageContext.request.contextPath}/firstEnterprise/getBusinessDeptAuditList");
				break;
			case 3:
				button_hide(6);
				getEnterpriseList("${pageContext.request.contextPath}/firstEnterprise/getQualityAdminAuditList");
				break;
			case 4:
				button_hide(7);
				getEnterpriseList("${pageContext.request.contextPath}/firstEnterprise/getQualityDeptAuditList");
				break;
			case 5:
				button_hide(8);
				getEnterpriseList("${pageContext.request.contextPath}/firstEnterprise/getQualityPeopleAuditList");
				break;
			case 6:
				button_hide(9);
				button_hide(10);
				getEnterpriseList("${pageContext.request.contextPath}/firstEnterprise/getWaitForProviderList");
				break;
			case 7:
				button_hide(null);
				getEnterpriseList("${pageContext.request.contextPath}/firstEnterprise/getProviderList");
				break;
			}
		}
		function foreach_hide(start, end) {
			for ( var i = start; i <= end; i++) {
				$('.div_button').find('ul li:nth-of-type(' + i + ') span').css(
						'display', 'block');
			}
		}
		function button_hide(no) {
			$('.div_button').find('ul li:nth-of-type(' + 4 + ') span').css(
					'display', 'block');
			if (no != null)
				$('.div_button').find('ul li:nth-of-type(' + no + ') span')
						.css('display', 'block');
		}

		//自动填充表单
		$.fn.populateForm = function(data) {
			return this.each(function() {
				var formElem, name;
				if (data == null) {
					this.reset();
					return;
				}
				for ( var i = 0; i < this.length; i++) {
					formElem = this.elements[i];
					//checkbox的name可能是name[]数组形式
					name = (formElem.type == "checkbox") ? formElem.name
							.replace(/(.+)\[\]$/, "$1") : formElem.name;
					if (data[name] == undefined)
						continue;
					switch (formElem.type) {
					case "checkbox":
						if (data[name] == "") {
							formElem.checked = false;
						} else if (data[name] == "1" || data[name] == 1) {
							formElem.checked = true;
						} else {
							//数查找元素
							if (data[name].indexOf(formElem.value) > -1) {
								formElem.checked = true;
							} else {
								formElem.checked = false;
							}
						}
						break;
					case "radio":
						if (data[name] == "") {
							formElem.checked = false;
						} else if (formElem.value == data[name]) {
							formElem.checked = true;
						}
						break;
					case "button":
						break;
					default:
						formElem.value = data[name];
					}
				}
			});
		};

		//根据url获取不同管理员对的待审核企业信息
		function getEnterpriseList(url) {
			$("#firstEnterpriseInfo")
					.dataTable(
							{
								"processing" : true,
								"serverSide" : false,
								"paginationType" : "full_numbers",
								"ajax" : url,
								"aaSorting" : [ [ 0, "desc" ] ],
								"aoColumnDefs" : [ {
									"orderable" : false,
									"aTargets" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9,
											10, 11, 12, 13, 14, 15, 16, 17, 18,
											19, 20, 21, 22 ]
								} ],
								/*  "dataSrc" : function(result){
								  return result.rows;
								},   */
								"columns" : [
										{
											"data" : "supplierEnterpriseNo",
											"defaultContent" : ""
										},
										{
											"data" : "enterpriseName",
											"defaultContent" : ""
										},
										{
											"data" : "inputCode",
											"defaultContent" : ""
										},
										{
											"data" : "linkman",
											"defaultContent" : ""
										},
										{
											"data" : "linkphone",
											"defaultContent" : ""
										},
										{
											"data" : "enterprisePhone",
											"defaultContent" : ""
										},
										{
											"data" : "registerAddress",
											"defaultContent" : ""
										},
										{
											"data" : "varietyControl",
											"defaultContent" : ""
										},
										{
											"data" : "dutyNo",
											"defaultContent" : ""
										},
										{
											"data" : "entrustLimitedDate",
											"defaultContent" : "",
											"render" : function(data, type,
													full, meta) {
												//时间格式化
												return moment(data).format(
														"YYYY-MM-DD");
											}
										},
										{
											"data" : "licenseNo",
											"defaultContent" : ""
										},
										{
											"data" : "socialCreditCode",
											"defaultContent" : "",

										},
										{
											"data" : "businessEndDate",
											"defaultContent" : "",
											"render" : function(data, type,
													full, meta) {
												//时间格式化
												return moment(data).format(
														"YYYY-MM-DD");
											}
										},
										{
											"data" : "economicNature",
											"defaultContent" : ""
										},
										{
											"data" : "certificateEndDate",
											"defaultContent" : "",
											"render" : function(data, type,
													full, meta) {
												return moment(data).format(
														"YYYY-MM-DD");
											}
										},
										{
											"data" : "qualityEndDate",
											"defaultContent" : "",
											"render" : function(data, type,
													full, meta) {
												return moment(data).format(
														"YYYY-MM-DD");
											}
										}, {
											"data" : "qualitySituation",
											"defaultContent" : ""
										}, {
											"data" : "qualityDirecter",
											"defaultContent" : ""
										}, {
											"data" : "ahrqPeopleCount",
											"defaultContent" : ""
										}, {
											"data" : "nhrqContactWay",
											"defaultContent" : ""
										}, {
											"data" : "recordsNo",
											"defaultContent" : ""
										}, {
											"data" : "retracementReason",
											"defaultContent" : ""
										}, {
											"data" : "remark",
											"defaultContent" : ""
										}, ]
							});
		}

		// 处理日期格式
		function formatDate(data) {
			var enterprise = eval(data);
			if (enterprise.varietyControl == 1) {
				$("#isVarietyControl").attr("checked", "checked");
			} else {
				$("#isVarietyControl").attr("checked", false);
			}
			if (enterprise.sellColdItem == 1) {
				$("#isSellColdItem").attr("checked", "checked");
			} else {
				$("#isSellColdItem").attr("checked", false);
			}
			var date = new Date();
			if (enterprise.entrustLimitedDate != ""
					&& enterprise.entrustLimitedDate != null) {
				date = new Date(enterprise.entrustLimitedDate);
				enterprise.entrustLimitedDate = date.format("yyyy-MM-dd");
			}
			if (enterprise.businessEndDate != ""
					&& enterprise.businessEndDate != null) {
				date = new Date(enterprise.businessEndDate);
				enterprise.businessEndDate = date.format("yyyy-MM-dd");

			}

			if (enterprise.inputDate != "" && enterprise.inputDate != null) {
				date = new Date(enterprise.inputDate);
				enterprise.inputDate = date.format("yyyy-MM-dd");
			}

			if (enterprise.organizationLimitedDate != ""
					&& enterprise.organizationLimitedDate != null) {
				date = new Date(enterprise.organizationLimitedDate);
				enterprise.organizationLimitedDate = date.format("yyyy-MM-dd");
			}
			if (enterprise.qualityStartDate != ""
					&& enterprise.qualityStartDate != null) {
				date = new Date(enterprise.qualityStartDate);
				enterprise.qualityStartDate = date.format("yyyy-MM-dd");
			}

			if (enterprise.qualityEndDate != ""
					&& enterprise.qualityEndDate != null) {
				date = new Date(enterprise.qualityEndDate);
				enterprise.qualityEndDate = date.format("yyyy-MM-dd");
			}

			if (enterprise.certificateStartDate != ""
					&& enterprise.certificateStartDate != null) {
				date = new Date(enterprise.certificateStartDate);
				enterprise.certificateStartDate = date.format("yyyy-MM-dd");
			}

			if (enterprise.certificateEndDate != ""
					&& enterprise.certificateEndDate != null) {
				date = new Date(enterprise.certificateEndDate);
				enterprise.certificateEndDate = date.format("yyyy-MM-dd");
			}

			if (enterprise.businessStartDate != ""
					&& enterprise.businessStartDate != null) {
				date = new Date(enterprise.businessStartDate);
				enterprise.businessStartDate = date.format("yyyy-MM-dd");
			}

			if (enterprise.businessEndDate != ""
					&& enterprise.businessEndDate != null) {
				date = new Date(enterprise.businessEndDate);
				enterprise.businessEndDate = date.format("yyyy-MM-dd");
			}
			if (enterprise.qualityPeopleConclusionDate != ""
					&& enterprise.qualityPeopleConclusionDate != null) {
				date = new Date(enterprise.qualityPeopleConclusionDate);
				enterprise.qualityPeopleConclusionDate = date
						.format("yyyy-MM-dd");
			}

			if (enterprise.businessAuditDate != ""
					&& enterprise.businessAuditDate != null) {
				date = new Date(enterprise.businessAuditDate);
				enterprise.businessAuditDate = date.format("yyyy-MM-dd");
			}

			if (enterprise.qualityAdminDate != ""
					&& enterprise.qualityAdminDate != null) {
				date = new Date(enterprise.qualityAdminDate);
				enterprise.qualityAdminDate = date.format("yyyy-MM-dd");
			}

			if (enterprise.qualityDeptDate != ""
					&& enterprise.qualityDeptDate != null) {
				date = new Date(enterprise.qualityDeptDate);
				enterprise.qualityDeptDate = date.format("yyyy-MM-dd");
			}
			if (enterprise.qualityPeopleOpinionDate != ""
					&& enterprise.qualityPeopleOpinionDate != null) {
				date = new Date(enterprise.qualityPeopleOpinionDate);
				enterprise.qualityPeopleOpinionDate = date.format("yyyy-MM-dd");

			}
			return enterprise;
		}
		//默认显示当前日期
		Date.prototype.format = function(format) {
			var o = {
				"M+" : this.getMonth() + 1, //month
				"d+" : this.getDate(), //day
				"h+" : this.getHours(), //hour
				"m+" : this.getMinutes(), //minute
				"s+" : this.getSeconds(), //second
				"q+" : Math.floor((this.getMonth() + 3) / 3), //quarter
				"S" : this.getMilliseconds()
			//millisecond
			};
			if (/(y+)/.test(format))
				format = format.replace(RegExp.$1, (this.getFullYear() + "")
						.substr(4 - RegExp.$1.length));
			for ( var k in o)
				if (new RegExp("(" + k + ")").test(format))
					format = format.replace(RegExp.$1,
							RegExp.$1.length == 1 ? o[k] : ("00" + o[k])
									.substr(("" + o[k]).length));
			return format;
		};

		var a = document.getElementById("inputDate");
		var b = new Date();
		a.value = b.format('yyyy-MM-dd');
	</script>
</body>

</html>